# -*- coding: utf-8 -*-  
__author__ = 'hftec'
import threading, time
#import Server
import SerialComunicate
class UdpThread:

    def __init__(self,udp):
        self.udp = udp
        self.udp_data = threading.Thread(target = self.wait_data)

    def wait_data(self):
        while(True):
            try:
                data = self.tcp.recv(512)
                if data == '':
                    return
                print "data",data
                SerialComunicate.serial.write(data)
            except:
                return

